﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctlGridView.ascx.cs" Inherits="UserControls_ctlGridView" %>
<%@ Register src="ctlMessage.ascx" tagname="ctlMessage" tagprefix="uc1" %>
<%@ Register src="ctlConfirmationMessage.ascx" tagname="ctlConfirmationMessage" tagprefix="uc2" %>

<!-- End .clear -->
<div id="FixingTables">
    <asp:GridView ID="GridView" runat="server" 
        AllowPaging="True" AutoGenerateColumns="False" 
        OnRowCommand="GridView_RowCommand" CssClass="FixingTables">
        <Columns>
            <asp:BoundField DataField="Id" HeaderText="Id" HeaderStyle-CssClass="hideGridColumn" ItemStyle-CssClass="hideGridColumn">
            <HeaderStyle Font-Bold="True" />
            </asp:BoundField>
            <asp:BoundField DataField="Name" HeaderText="Nombre">
                <HeaderStyle Font-Bold="True" />
                <ItemStyle Wrap="true" />
            </asp:BoundField>
            <asp:ButtonField ButtonType="Image" CommandName="Select" 
                HeaderText="Seleccionar" 
                ImageUrl="~/App_Themes/SimplaAdmin/images/icons/magnifier--arrow.png" 
                Text="Select">
                <HeaderStyle Font-Bold="True" />
                <ItemStyle Width="90px" Wrap="False" />
            </asp:ButtonField>
            <asp:ButtonField ButtonType="Image" CommandName="Modify"
                HeaderText="Modificar" 
                ImageUrl="~/App_Themes/SimplaAdmin/images/icons/pencil.png" 
                Text="Edit">
                <HeaderStyle Font-Bold="True" />
                <ItemStyle Width="90px" Wrap="False" />
            </asp:ButtonField>

            <asp:TemplateField HeaderText="Eliminar">
                 <ItemTemplate>
                      <asp:ImageButton ID="eliminarElemento" runat="server" CommandName="Eliminate" CommandArgument="<%# Container.DataItemIndex %>" ImageUrl="~/App_Themes/SimplaAdmin/images/icons/cross.png" />
                      <uc2:ctlConfirmationMessage runat="server" Title="Confirmación de borrado" Message="Esta seguro que desea eliminar este elemento?" TargetControlId="eliminarElemento"  />
                 </ItemTemplate>
            </asp:TemplateField>

        </Columns>
    </asp:GridView>
</div>

<!--<asp:ButtonField ButtonType="Image" CommandName="Eliminate" 
    HeaderText="Eliminar" 
    ImageUrl="~/App_Themes/SimplaAdmin/images/icons/cross.png" 
    Text="Delete">
    <HeaderStyle Font-Bold="True" />
    <ItemStyle Width="90px" Wrap="False" />
</asp:ButtonField>-->